Dual journaling store method and storage medium thereof

ABSTRACT

The present invention provides a dual journaling storing method and a storage medium thereof, in which data are stored toward a central portion of a storage space of the storage medium from start and end locations when a flash memory or the like is used as a storage medium for storing/managing/processing data. One data is stored from a start location of the storage medium based an the journaling method, and another data is stored from an end location of the storage medium toward the start location.

TECHNICAL FIELD

The present invention relates to a dual journaling storing method and astorage medium thereof, in which data are stored toward a centralportion of a storage space of the storage medium from start and endlocations when a flash memory or the like is used as a storage mediumfor storing/managing/processing data.

BACKGROUND ART

In recent years, as information society and mobile computing technologyare rapidly advanced, personal digital assistants (PDA), hand-heldpersonal computer (HPC), cellular phone, e-book and the like have beendeveloped. In addition, for the purpose of data storage, many flashmemories are widely used because they are very handy to carry and have afast access time and a low power consumption.

A flash memory has features different from a general random accessmemory (RAM). The flash memory can be nonvolatile and firmer than a harddisk drive. Additionally, the flash memory can operate with low powerand has an access time as fast as the RAM. Further, the flash memory isadaptable to portable devices because of its small size.

However, the flash memory is five to ten times more expensive than thehard disk drive and has a disadvantage in that a cleaning operation mustbe carried out in order to write a new data to a space where data hasalready existed.

For instance, while 28F640J3A flash memory developed by IntelCorporation has a fast read speed of 100 to 150 nsec, which is similarto the RAM, its write speed and erase speed are relatively slow. Ittakes 218 μsec to write data when 32-byte buffer is used, and a writetime of an erase block unit is 0.8 sec per block.

In addition, an erase block size that can be erased at a time isconstantly 128 Kbytes. The flash memory can perform erase/writeoperations 100,000 times at a room temperature. Such a space of theflash memory, which can be erased at a time, is called “erase block” or“segment”.

Flash memories can be classified into NOR type, NAND type and AND typeaccording to cell structures. Generally, the NOR or NAND flash memory iswidely used. The NOR flash memory has a fast random-access read speedand an easiness of access per bit. Therefore, the NOR flash memory isdirectly connected to a memory address space and mainly used to storecodes executed by CPU. Meanwhile, the NAND flash memory has a relativelyslow random access time, so that it is mainly used to store relativelylarge data, such as music files or image files, at a time.

Conventional file systems using these flash memories are disclosed inU.S. Pat. No. 5,404,485, entitled. “Flash Memory System”, and in a paper“A Flash Memory Based File System”, pp. 155-164, published at USENIXconference in 1995.

Additionally, there is provided a journaling flash file system (JFFS),in which a log-structured file system is applied to a flash memory. Thelog-structured file system is disclosed in U.S. Pat. No. 6,128,630entitled “Journal space release for log-structured storage systems” andU.S. Pat. No. 5,530,850 entitled “Data storage library array withlog-structured file system which allows simultaneous write and garbagecollection”.

When a file system is configured in a hard disk drive and data isstored, the log-structured file system employs a journaling storingmethod. Accordingly, the log-structured file system has an advantage inthat versions of a previous data and a new modified data can bemaintained in a log format. Further, erroneous data can be restored tothe previous data.

The JFFS configures the file system of the flash memory using thelog-structured file system and sequentially stores.

The JFFS was developed by Axis Communications(http://developer.axis.com/software/jffs/) of U.S.A, and JFFS2 has beendeveloped under GNU public licenses (GPL) of free software foundation(FSF) by RedHat (http://sources.redhat.com/jffs2) of U.S.A.

FIG. 1 is an exemplary view of a storing method of JFFS2 whichconfigures a file system of a flash memory.

In FIG. 1, there is shown one example of storing data into the flashmemory in the JFFS. In case there is a directory structure in a certainfile system, for example, EXT2 of Linux, a directory entry (Dir 1 entry)is stored in order to contain a general characteristic of one directory,as shown in FIG. 1(a). Here, the stored information is a directory nodetype, a total length of node, a cyclic redundancy check (CRC) of head,parent inode number, version value, node CRC, name CRC, directory name,etc.

As shown in FIG. 1, a directory inode (Dir 1 inode) is stored after thedirectory entry (Dir 1 entry). The information stored in the directoryinode (Dir 1 inode) includes a node type, a total length, various kindsof CRC, version value, user ID, group ID, created time, accessed time,modified time, etc.

The directory entry and the directory inode are additional informationused only in the file system, not information that is visible to theuser. They are called “meta data”. In the same manner, when a filecontained in the directory is stored, a file entry (File 1 entry) and afile inode (File 1 inode) are stored sequentially.

The directory and the file are considered as the same format in the filesystem. However, while there is no actual data in the directory, a filedata (File 1 data) is stored after the file inode (File 1 node).

In this manner, the JFFS employs a method for journaling the directoryand file of the flash memory. As shown in FIG. 1(b), if the directoryinode (Dir 1 inode) and the file inode (File 1 inode) are changed andupdated with new values, the original meta data are changed into aninvalid state and new data are sequentially stored in storage locations.

At this time, the invalid state is only to indicate that the data are anunnecessary data, not to actually erase the data. Version values of thenew data increase by one stage. Therefore, if a problem occurs in thenew data, data can be easily restored only if there are the data of theprevious version.

In this manner, if the directory and the file are updated and new dataare stored many times, the storage space of the flash memory reaches thelimit. Thus, data stored in the flash memory must be erased in order tosecure the storage space. Since the data must be erased only by theerase block unit due to the characteristic of the flash memory, thevalid data (Dir 1 entry) moves as shown in FIG. 1(c). Then, if the eraseblock is filled with invalid spaces, the cleaning operation is carriedout to erase one erase block, as shown in FIG. 1(d).

The above process of securing the new storage space is called “garbagecollection (GC)” In other words, when it is necessary to secure the newstorage space for lack of the storage space, the garbage collection iscarried out by collecting the invalid spaces and cleaning the eraseblock by the erase block unit. In addition, the space where the new datacreated through the cleaning operation can be stored is called “freespace”. By securing large free space, data can continue to be stored.

In case the hard disk drive is used as the storage medium, data can bestored in the similar manner. In case of the hard disk drive, however,the invalid data does not move and the invalid block having the eraseblock size is not created in order to secure the storage space.

However, in order to obtain the fast access to the file in the hard diskdrive, several pieces of the same file are collected and moved to aphysically adjacent location. Since the hard disk drive need not performthe cleaning operation separately, the data are directly stored if thespace where the new data are stored is in the invalid state.

If the storing method of the JFFS is carried out, the locations of theentry and the inode are mixed complicatedly with the data of the file.Therefore, when the file system is configured by connecting and mountingthe flash memory and an operating system (OS), the entire space of theflash memory must be read out and the metal data must be found in orderto configure the tree-type directory structure.

The same problem also occurs when a log-structured file system or ajournaling file system is configured using the hard disk drive as thestorage medium, instead of the flash memory. In other words, althoughthe data need not move in order to collect the erase block like the caseof the flash memory, the access speed becomes 40-50 times slower thanthe flash memory because the meta data are mixed with the data of thefile and scattered throughout the space. In addition, it takes much timeto configure the file system by reading out the entire disk whosecapacity can be more than gigabytes.

The hard disk drive mainly uses the log-structured file system or thejournaling file system to store and reproduce a large-size multimediadata. However, the utility as the multimedia file system is degraded ifthe data is not transmitted at a constant speed per predetermined timedue to the mixture of the meta data.

DISCLOSURE OF THE INVENTION

Accordingly, the present invention is directed to a dual journalingstoring method that substantially obviates one or more of the problemsdue to limitations and disadvantages of the related art.

An object of the present invention is to provide a dual journalingstoring method, in which data are divided into meta data and generalfile data. The file data is stored from a start location of a storagemedium and the meta data is stored from an end location of the storagemedium.

Additionally, in the dual journaling storing method of the presentinvention, the meta data is stored in the storage medium from a startlocation toward a rear portion, and the file data is stored from an endlocation toward a front portion.

Here, the dual journaling storing method can be applied to other dataand other first and second kinds/characteristics of data, in addition tothe meta data and the file data.

The data of the same kind are stored from start locations of respectivepartitions in a flash memory device and the data of the different kindsare stored from end locations toward the front portion.

The data stored from the start locations will be referred to as “frontjournaling” data, and the data stored from the end locations will bereferred to as “rear journaling” data.

A location where the storage occurs will be referred to as “head”, and alocation where an erase operation is carried out at a rear portion ofthe journaling will be referred to as “tail”. In other words, a head andtail of the front journaling data and a head and tail of the rearjournaling data exist. Additionally, due to an increase of heads on bothsides of the front and rear portions, the front and rear portions meeteach other. Here, the location where the front and rear portions meeteach other will be referred to as “central location”.

If the data to be stored enters a file system of the respectivepartitions in the flash memory device, the storage medium needs a spacefor physically storing data and a space for storing meta data, such asthe file entry and inode, which are necessary for creating the filedata.

In this case, the file data and the meta data can be stored in the frontjournaling and the rear journaling, respectively. In other words, thefile data and the meta data are respectively stored from the frontportion and rear portion of the storage medium, and vice versa.

According to the dual journaling storing method of the presentinvention, when it is intended to store an arbitrary data in the storagemedium, the store operation is carried out after determining in whichportion the data will be stored. In case the data is updated, theprevious data is invalidated and new data is stored in a location of thehead. In case the data is erased, the invalidation is only marked to thedata.

If the storage and update are repeated in this manner, the frontjournaling and the rear journaling meet each other, so that the centrallocation is determined. In case both the front portion and the rearportion return to their initial location and data continue to beprocessed, one of them arrives first at the central location. At thistime and subsequent times, it can be determined that the journalingarriving first at the central location C has a large amount of data tobe stored. Therefore, the central location C moves toward the otherparty in order to increase the space for the journaling having a largeamount of data.

In case of the flash memory, an object of the journaling storing methodis to properly assign the number of erase times with respect to theerase block. If the central location moves, the journaling having alarge amount of data is increased. As a result, it is possible toproperly assign the number of erase times with respect to the front andrear portions.

Additionally, the flash memory device according to the present inventionincludes a processor for generating read and write commands forreading/write data from/to a specific address of a RAM, a flash memoryfor providing a data storage space, and a memory controller forcontrolling the data to be stored in the memory by using the hereindescribed dual journaling storing method.

Further, according to the dual journaling storing method of the presentinvention, the flash memory device allowing the read operation duringthe write operation includes a plurality of partitions. The respectivepartitions can perform the read, write and erase operations togetherwith other partitions (e.g., independently). The data stored in therespective partitions of the flash memory are divided into the meta dataand the general file data. The file data is stored from the startlocation of the storage medium, that is, the respective partitions.Meanwhile, the meta data is stored from the end location of therespective partitions toward the start location.

A flash memory device according to the present invention includes: amultiple-partitioned memory; a plurality of partitions provided by amultiple partition of the memory, in which data being stored areindependently read, written or erased; a charge pump for providing aplurality of voltage levels necessary to read, write and erase the data;and a plurality of first sense amplifiers configured for a readoperation, in which the read operation is simultaneously executable forthe respective partitions; a plurality of second sense amplifiersincluding at least one sense amplifier configured for erase and writeoperations, in which the erase and write operations are simultaneouslyexecutable for the respective partitions and the data are stored in therespective partitions from start and end locations of storage spaces ofthe respective partitions toward respective central portions.

The data stored in the respective partitions are stored from the startand end locations of the storage space toward the central portion.

Further, a mobile terminal according to the present invention includesthe multiple-partitioned flash memory device, a plurality of buses, anda processor connected to the buses. At this time, themultiple-partitioned flash memory is connected to the bus and can beaccessed by the processor.

Furthermore, a mobile terminal according to the present inventionincludes a storage device such as the flash memory or a hard disk drive(HDD), a plurality of buses, and a processor connected to the buses. Atthis time, the storage device is connected to the buses and can beaccessed by the processor.

Additional features and advantages of the invention will be set forth inthe description which follows, and in part will be apparent from thedescription, or may be learned by practice of the invention. Theobjectives and other advantages of the invention will be realized andattained by the structure particularly pointed out in the writtendescription and claims thereof as well as the appended drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are included to provide a furtherunderstanding of the invention and are incorporated in and constitute apart of this specification, illustrate embodiments of the invention andtogether with the description serve to explain the principles of theinvention.

In the drawings:

FIG. 1 is an exemplary view of a storing method in a JFFS2 configuring afile system into a flash memory.

FIG. 2 exemplarily illustrates a center location that is determined whena head of a front journaling data and a head of a rear journaling datameet with each other in a dual journaling storing method according to anembodiment of the present invention;

FIG. 3 exemplarily illustrates a process of determining a new centrallocation in the dual journaling storing method according to the presentinvention, in which a new central location is determined by moving thecentral location toward the rear journaling, when the head of the rearjournaling arrives first at the central location after the centrallocation is determined;

FIG. 4 is a flowchart illustrating a dual journaling storing methodaccording to an embodiment of the present invention;

FIG. 5 is a flowchart of the garbage collection (GC) process as aportion of the dual journaling storing method;

FIG. 6 is a graph for determining the number of erase blocks in thegarbage collection (GC) process of the dual journaling storing method;

FIG. 7 is a schematic block diagram of a flash memory applicable in thedual journaling storing method according to an embodiment of the presentinvention;

FIG. 8 is a block diagram of a flash memory device according to anembodiment of the present invention;

FIG. 9 illustrates a multiple-partitioned flash memory device accordingto an embodiment of the present invention; and

FIG. 10 illustrates an exemplary mobile terminal using the flash memorydevice according to the present invention.

BEST MODE FOR CARRYING OUT THE INVENTION

Hereinafter, preferred embodiments of the present invention will bedescribed in detail with reference to accompanying drawings.

FIG. 2 exemplarily illustrates a center location that is determined whena head of a front journaling data and a head of a rear journaling datameet with each other in a dual journaling storing method according to anembodiment of the present invention.

In FIG. 2(a), reference symbols “H1” and “T1” denote a head and a tailof a front journaling data, respectively. Reference symbols “H2” and“T2” denote a head and a tail of a rear journaling data, respectively. Areference symbol “C” denotes a central location.

If data Data1 enters a file system in respective partitions, it isdetermined whether the kind of data is the front journaling data or therear journaling data, and its result is then stored in the heads.

Referring to FIG. 2(a), since the data Data1 is the front journalingdata, the data Data1 is stored from a start location of the storagemedium.

FIG. 2(b) illustrates a state when six data are stored. Four data Data1to Data4 are the front journaling data and two data Data5 and Data6 arethe rear journaling data.

The data Data2 and Data6 are erased. At this time, the data may not beerased actually due to a characteristic of the journaling storing methodbut represented with invalid states.

FIG. 2(c) illustrates a state when a garbage collection (GC) is carriedout for lack of the storage space in the storage medium. In other words,since the data Data1 is a valid data, the data Data1 moves to the headand the previous data Data1 is then invalidated. If size of the dataData1 and the previously invalidated data Data2 exceeds the erase blocksize, an erase operation is actually carried out to thereby secure afree space.

In case of the flash memory, the erase operation is actually carriedout. Meanwhile, in case of the disk, it is unnecessary to separatelycarry out the erase operation.

If the free space is secured, the tail T1 corresponding to the endportion of the front journaling moves to a location of the data Data3.In the same manner, if the data Data6 is invalidated and erased afterthe data Data6 becomes the erase block size, the tail T2 of the rearjournaling also moves.

In this state, it is intended to store a new data Data7. Although it isintended to store the data Data7 in the front head H1 as the frontjournaling data, the space is lacking.

Therefore, as shown in FIG. 2(d), only a data D7-1 is stored. Here, thedata D7-1 corresponds to a portion which can be stored. Then, the fronthead H1 returns to the start location and the remaining data D7-2 isstored.

In this manner, if the front journaling meets the rear journaling, itreturns to the start location and is then stored. The location where thefront head H1 and the rear head H2 meet each other is set as the centrallocation C. At this time, the rear head H2 also returns to the endlocation and waits for a storage. In other words, in this manner, dataare stored in the front and rear journalings and the central location isset.

When data continue to be stored in this manner, one of the front andrear heads H1 and H2 arrives first at the central location C. In thiscase, it can be determined that the journaling arriving first at thecentral location C has a large amount of data to be stored.

Therefore, the central location C moves toward the is other party inorder to increase the space for the journaling that arrives first at thecentral location.

FIG. 3 exemplarily illustrates a process of determining a new centrallocation in the dual journaling storing method according to the presentinvention. In FIG. 3, after the central location is determined, in casethe head of the rear journaling arrives first at the central location, anew central location is determined by moving the central location towardthe front journaling.

Referring to FIG. 3(a), data Data3 and Data5 are invalidated and therear journaling data are stored actively, so that data Data8 and Data9are stored. Although it is intended to store data Data10, a storagespace is lacking.

In other words, this is a case the rear journaling arrives first at thecentral location C. Here, since the rear head H2 does not meet the fronthead H1, the central location C moves toward the front portion as longas a sufficient data storage space exists in the front portion.

The process of determining whether or not enough data exist in the frontportion is carried out in a garbage collection of FIG. 5, which will bedescribed later.

For the purpose of this process, the front data D7-1 moves to the fronthead H1 and the central location C also moves toward the front portion,as shown in FIG. 3(b).

At this time, in case of the flash memory, unit of data moving towardthe front portion is an erase block unit.

The reason is that a new data cannot be stored until a free space iscreated by carrying out a clear operation after the movement.

Here, the erase block means a memory unit that can be erased at a timein the flash memory. In general, the memory unit is 128 Kbytes or 256Kbytes. At this time, if a cleaning operation is carried out to theerase block, a free block is created. Here, the “free block” is a spacewhere data can be stored and the “free space” means a free block with apredetermined size.

After such a free space is created, a new data Data10 is stored.

The central location C moves until it meets the front head H1 or untilthe data storage space sufficiently exists in the front portion.

FIG. 4 is a flowchart illustrating a dual journaling storing methodaccording to the present invention.

In other words, FIG. 4 illustrates the flowchart of the dual journalingstoring methods such as described in FIGS. 2 and 3, in which the methodincludes the process of storing the data, the process of determining thecentral location, and the process of moving the central location.

Referring to FIGS. 2 to 4, initial values of the front head H1, the rearhead H2, the front tail T1, the rear tail T2 and the central location Care basically set to zero (S101). These are the initial states when thefront journaling data and the rear journaling data are stored.

The data storage is requested to the file system through a buffer. Ifthe data storage is requested to the storage medium in this state(S102), it is checked whether or not the storage space is sufficient bythe garbage collection (EC), which will be described later withreference to FIG. 5 (S103).

If it is determined that the storage space of the storage medium issufficient, the process returns directly to the flowchart of FIG. 4.Meanwhile, if it is determined that the storage space of the storagemedium is insufficient, the process returns to the flowchart of FIG. 4after the storage space is secured.

Then, it is checked whether or not the central location C is zero(S104). This process is carried out for checking whether or not thecentral location is determined for the first time. The reason is thatthe process in the initial state before the central location C isdetermined is different from the process in a state after the centrallocation C is determined.

In other words, in case the central location C is determined at thefirst time, it must be checked-whether the head of one side meets thehead of the other side. Meanwhile, in case the central location C hasbeen already determined, it must be checked which head first meets thecentral location C.

According to the checking result of the step S104, in case the centrallocation C is zero or not zero, it is respectively checked whether ornot the data is the front journaling data (S105). Then, the data isstored according to the respective cases.

It is assumed that the central location C is zero, the new stored datais the front journaling data, that is, the data is being stored from thefront portion of the storage medium, and its size is S.

In this case, if the data is stored, it means that a head of the frontjournaling data is newly located at “H1+S”. First, the step 9106 iscarried out for checking whether or not there is a space enough to storethe data whose size is “S”.

If the head H1+S of the stored front journaling data does not meet witha head H2 of the rear journaling data, that is, if (H1+S)≦H2, it meansthat the storage space is sufficient. Therefore, the front journalingdata is stored from the location H1, so that the head of the dataincreases from the previous location H1 to the location H1+S (S108).This corresponds to the contents described in FIGS. 2(a) and 2(b). Here,the locations H1 and H2 are addresses that increase, for example, bybyte unit in the flash memory and the data size S is a byte unit, sothat they can be correspondingly operated using an equal unit.

Meanwhile, if (H1+S)≦H2 is not satisfied, that is, if the head H1+S ofthe front journaling data meets with the head H2 of the rear journalingdata, only a storable size (H2-H1) among the data size S is stored fromthe location H1 (S109).

Additionally, in this case, the location H2 is determined as the centrallocation like FIG. 2(d), and the remaining portion [S−(H2−H1)] of thedata is stored from the start location of the front journaling.

In other words, as shown in the step S109, the central location C is notzero any more, H1 becomes zero, the remaining portion [S−(H2−H1)] of:the data is stored from zero, and H1 increases as much as [S−(H2−H1)].This corresponds to the contents described in FIGS. 2(c) and 2(d). Inother words, H1 in FIG. 2(d) corresponds to [S−(H2−H1)] and becomes anew storage location.

If the data being stored is the rear journaling data, the data is storedin a manner that is symmetrical (e.g., S106, S108, S109) with the abovedescription (S107).

Additionally, in the step S104, if the central location C is not zero,it is checked whether or not the data being stored is the frontjournaling data (S110).

When the central location C is not zero, the head of the frontjournaling data and the head of the rear journaling data have alreadymet each other so that the central location has been determined.Therefore, in case the data being stored is the front journaling data,it must be checked whether or not the head (H1+S) exceeds the centrallocation C. This is different from the above description.

At this time, if the head H1+S of the front journaling data does notexceed the central location C, that is, (H1+S)≦C, it means that thestorage space is sufficient (S111). Therefore, the front journaling datais stored from the location H1, so that the head of the data increasesfrom the previous location H1 to the location H1+S (S112).

Meanwhile, if (H1+S)≦C is not satisfied, that is, if to the head H1+S ofthe front journaling data meets with the central location C, only astorable size (C−H1) among the data size S is stored from the locationH1 (S114).

This step is carried out in order to secure the sufficient space when itis determined that there is a large quantity of the front journalingdata. Through this step, the storing times in the flash memory can beassigned properly.

However, if the central location C moves toward the rear portion, avalid data of the rear journaling data moves to the location H2. At thistime, it must be checked whether or not there is a storable space in therear portion (S115). In other words, it is checked whether or not thereis a storage space where the remaining portion [S−(C−H1)] of S can bestored. This corresponds to the contents described in FIG. 3(b).

If there is the storable space in the rear portion, data as much as[S−(C−H1)] moves to the location H2 (S116) and a new data [S−(C−H1)] isstored in that location. It can be understood through the movement ofD7-1 to the location H1 in FIG. 3(b). Although FIG. 3 illustrates thecase that the central location moves toward the front portion, itsprinciple is equal to that described above.

Meanwhile, if there is no storable space in the rear portion, it meansthat the rear portion is filled with data. Therefore, the centrallocation moves toward the rear portion as much as the storable portion.The remaining portion returns to the position “0” (that is, H1=0) and isthen stored (S118).

If the data being stored is the rear journaling data, it is stored in amanner that is symmetrical (e.g., corresponding to S111, S112,S114-S118) with the above description (S113).

If the process of storing the data is ended, the garbage collection (GC)process is carried out.

FIG. 5 is a flowchart of the garbage collection (GC) process as aportion of the dual journaling storing method.

Referring to FIG. 5, if the data storage is requested, the garbagecollection (GC) process is carried out to check whether or not there isthe free space where the data can be stored.

The data to be stored exists in the storage buffer for the moment. Ifthere is no free space as much as a data size to be stored, the datamoves using the journaling method and the cleaning operation is carriedout after the invalid space is collected as much as the erase block.Then, if the minimum space for the new data is secured, the storingprocess is first carried out. Till now, a first portion GC process iscalled in FIG. 4 (S101 to S103).

It is checked whether or not there are the data in the buffer in a statethat the free block for a predetermined data size exists (S202). Ifthere are the data in the buffer, it is checked whether all data are thefront journaling data (S203).

At this time, the free block is formed after the cleaning process iscarried out to the erase block, and it means the space where the datacan be stored. Additionally, the free block with a predetermined sizeforms the free space.

In the step S203, in case the data is not the front journaling data, therear portion is processed using the same manner as the front portion(S204). On the contrary, in case the data is the front journaling data,it is checked whether or not the free space is sufficient (S205).

If the free space is sufficient, the garbage collection (GC) process isended. On the contrary, if the free space is insufficient, the validspace moves from the front tail T1 to the front head H1. Thereafter, theinvalid space is secured in the erase block and then erased (S206).

Meanwhile, after storing an inserted data, the GC process is againcalled in order to secure the sufficient space within the storage space.At this time, the number of the erase blocks to be cleaned is determinedusing the decision graph of FIG. 6. This is carried out when there is nodata to be stored in the storage buffer.

In this state, as shown in FIG. 6, if N₂ or more free blocks are securedin the decision graph, the cleaning operation is no longer carried outto the erase block. The value “N₂” is generally set to about 10% of theentire storage space. In case the number of the current free block isbetween N₁ and N₂, a predetermined number of the erase blocks arecleaned in order to secure N₂ or more free blocks to the maximum (S207,S208, S210 and S211).

At this time, the value N₁ means a threshold value in which the freeblock is exhausted and can be set to 2 or 3 according to its setup. Inother words, in case only two or three free blocks remain in the currentsystem, the system preferentially moves the valid data to other freeblock among the erase blocks where the invalid data and the valid dataare mixed. Accordingly, if the erase block becomes the invalid block,the free space is secured by carrying out the cleaning process.

Additionally, the value N₂ is set to about 10% of the number of theerase blocks in the entire flash memory.

Since the time taken to clean the erase blocks of the flash memory is 2to 10 times longer than the data store time and 100 to 1000 times longerthan the data read time, the is cleaning process is frequently carriedout, resulting in a problem that the system becomes slow as a whole.

Accordingly, when the space of the flash memory is consideredsufficient, the cleaning process is not carried out. A degree to whichthe free space of the flash memory is considered sufficient is generallyabout 10%. In the step S207, if the number of the current free blocks isequal to or less than N₁, the erase block is preferentially secured overall operations. If the number of the free erase blocks is equal to orless than N, even after the erase operation, it means that there is notthe storage space any more.

Additionally, in the step S210, if the number of the current free blocksis equal to or less than N₂, the invalid space is secured in the eraseblock and then cleaned (S210, S211).

The reason why the sufficient free space is not secured from the initialgarbage collection (GC) is because a latency time becomes long in orderto secure the sufficient free space when the request for the datastorage is received, while the cleaning operation needs a longer timeperiod than a read or write operation.

Further, in case the request for the read and write operations isreceived while the cleaning operation is carried out, most of the flashmemories can function to suspend the cleaning operating and performhigh-priority operations. Therefore, this function can be utilized.

Although the dual journaling storing method of the present inventiondescribed with reference to FIGS. 2 to 6 is applicable to variousstorage media, exemplary flash storage medium applicable to the dualjournaling storing method will be described below.

FIG. 7 is a schematic block diagram of the flash memory applicable inthe dual journaling storing method according to an embodiment of thepresent invention.

Referring to FIG. 7, the flash memory device according to the presentinvention includes a processor 10 for generating read and write commandsfor reading/write data from/to a specific address of a RAM 16, a flashmemory 12 for providing a data storage space, and a memory controller 14for controlling the data to be stored in the memory 12 according to thedual journaling storing method of the present invention.

FIG. 8 is a block diagram of the flash memory device according to anembodiment of the present invention. In this case, the data stored inthe memory 110 of the flash memory device is stored according to thedual journaling storing method, as described in FIGS. 2 to 6.

Referring to FIG. 8, the flash memory device 100 according to anembodiment of the present invention includes a memory 110 for storingdata, an X-decoder 160, a Y-selector 170 and a Y-decoder 180. TheX-decoder 160 and the Y-decoder 180 assigns addresses to rows andcolumns of the memory.

Additionally, a user interface 120 controls the flash memory device 100.The user interface 120 is connected to a processor for controlling anaccess to the memory 110, and a status register 130 stores a state ofthe memory 110 (e.g., a write state, a read state or an erase state).The processor acquires the state of the flash memory from the userinterface 120.

Further, sense amplifiers 140 are connected to the memory 110 to amplifysignals for the read or write operation from or to the memory 110. Forexample, in case there are columns with sixteen I/Os, sixteen senseamplifiers 140 are used for the sixteen I/Os one by one.

Furthermore, the flash memory 100 further includes a charge pump 150.The charge pump 150 is used to provide voltage levels necessary for thewrite, read and erase operations of the memory 110.

The flash memory device of the present invention is configured with onememory subset and performs the read or write operation by one block.Accordingly, the flash memory has a disadvantage in that the user cannotwrite data to a block simultaneously while erasing or reading otherblock of the memory.

However, a simultaneous operation is demanded in several applicationtechnologies limited by the erase time (generally, 250 to 500 ms) of theflash memory block. For example, a mobile telephone directly executescodes from the flash memory. It has an advantage in that the memoryblock divided for utilizing the data storage space can be erased.

Herein, the flash memory device capable of solving the problem andapplicable to the dual journaling storing method of the presentinvention will be described below with reference to FIG. 9.

FIG. 9 illustrates a multiple-partitioned flash memory device accordingto an embodiment of the present invention.

In FIG. 9, partitions A 210, B 216, C 225, D 220, E 230, . . . , n−1235, n 240.

Each of the partitions is provided with a unit that is physicallypartitioned in the flash memory device. In one embodiment, each of thepartitions is provided on a difficult physical layer. The respectivepartitions 210, 216, 220, 225, 230, 235 and 240 are connected with bothan X decoder and a Y decoder.

Each of Y selectors is connected to the Y decoder 290 for controllingthem. In another embodiment, a plurality of Y decoders 290 can existinside the system.

The X decoder and the Y decoder enable a selection of a specific regionwithin the flash memory for the purpose of the access including theread, write and erase operation. Through the plurality of X selectorsand the plurality of Y selectors, it is possible to perform an access toone or more subsections of the flash memory.

For example, the operation of writing data to the partition B and theoperation of reading data from the partition C are carried out at thesame time while the partition A is being erased. Each of the partitionscan include one or more blocks that can be erased separately.Accordingly, for example, it is possible to write data to the memory ofthe partition A while the memory block of the partition B is beingerased.

The user can control the access to the flash memory 200 through the userinterface 250. In one embodiment, the user interface 250 can be aportion of the flash memory itself. In another embodiment, the userinterface 250 can be disposed at a separate chip. The interface includesa plurality of state machines for controlling respective parallel writeoperations.

Accordingly, in case two parallel write operations (for example, anoperation of writing data to a data block while the codes are updated)are carried out, two state machines are provided. If three parallelwrite operations are carried out, three state machines are provided.

The status registers 260 are connected to the user interface 250. Thestatus registers 260 indicate a state of each partition. In oneembodiment, if there is the n number of partitions, the n number of thestatus registers 260 is provided. The state of each partition is any oneof “idle”, “being read”, “being written” and “being erased”.

Additionally, the sense amplifiers 270 are connected to the userinterface 250. The sense amplifiers are used for the read, write anderase operations.

In one embodiment, the number of the sense amplifiers 270 is determinedlike a following manner. In other words, in a 16-bit wide flash memory,sixteen sense amplifiers 270 are necessary for the respective executableparallel operations. For example, in case the first partition is readwhile the second partition is being written, thirty-two sense amplifiers270 are necessary.

Additionally, in case two partitions are read in parallel, thirty-twosense amplifiers 270 are necessary for the read operation. The number ofthe sense amplifiers 270 is a factor of a product of an output columnwidth (X) of the flash memory and the number (Y) of the executableparallel operations.

In one embodiment, in case of a triple-partitioned flash memory, thefirst, second and third partitions may be read, written and erased,respectively. In this case, 3× sense amplifiers are used. The senseamplifiers 270 used for the erase operation uses a very low ratio in atotal erase time.

In a similar manner, the sense amplifiers 270 used for the writeoperation use a low ratio in a total write time. Accordingly, in oneembodiment, one sense amplifier 270 is used for both the respectivelyexecutable parallel write operations and the respectively executableparallel erase operations.

In case the respective bits are written, the sense amplifier 270 is usedto verify the respective bits. Additionally, redundant sense amplifiers270 can be provided for other operations such as a redundant columnaccess.

In one embodiment, two redundant sense amplifiers 270 are providedwithin the sense amplifier block 270 in the respective parallel writeoperation and/or read operations.

Further, the charge pumps 280 are included in the circuit. The chargepumps 280 are used to adjust the voltage levels for the read, write anderase operations. In one embodiment, the voltage level necessary for theerase operation is about −10 volts.

In one embodiment, the voltage level necessary for the read and writeoperations are about 7 volts. In one embodiment, one charge pump 280having a plurality of lead lines is used to permit the parallel accessto the partitions.

In another embodiment, a plurality of separate charge to pumps 280 canbe used to provide the voltage level necessary to access the differentpartitions at the same time.

The charge pumps 280 are connected to the Y selectors of the respectivepartitions in order to increase the voltage level to levels adaptablefor the read, write and erase operations.

If the flash memory is sectioned into multiple partitions, therespective partitions can perform independently the read, write anderase operations. Accordingly, data are also stored independently in therespectively partitions.

At this time, the present invention is characterized in that the dataare stored in the respective partitions based on the dual journalingstoring method described above with reference to FIGS. 2 to 6.

The described-above dual journaling storing method and the flash memorydevice to which the storing method is applied can be used for variouspurposes.

As one embodiments a mobile terminal to which the dual journaling methodof FIGS. 2 to 6 and the multiple-partitioned flash memory device of FIG.9 are applied will be described below.

Here, the number of the partitions of the multiple-partitioned flashmemory device depends on the function of the flash memory. FIG. 10illustrates an exemplary mobile terminal using the flash memory deviceaccording to the present invention.

Usage examples of the triple-partitioned flash memory device are asfollows: (1) the partitions can be used to store data; (2) thepartitions can be used to store codes that are executed by an apparatuscontained in the flash memory device; and (3) the partitions can be usedto permit the update of the codes.

For example, in case the codes are changed due to the update, a new codeis written to the third partition at the same time while an originalcode stored in the second partition is executed.

If the new code is written and verified, the third partition is used forthe code. Accordingly, a seamless update of the flash memory ispossible.

In another embodiment of the triple-partitioned flash memory device, thecode is executed from the first partition and the data update isexecuted in the second partition. As a result of the code execution, theseamless data update can be achieved.

FIG. 10 illustrates an example of a mobile terminal employing the flashmemory device of the present invention.

Referring to FIG. 10, the mobile terminal 410 includes the flash memorydevice 430 according to an embodiment of the present invention.

Although the flash memory device 430 is drawn in the mobile terminal410, it should be understood that the flash memory device 430 isgenerally installed in a receptacle of the mobile terminal's body.

Additionally, the mobile terminal includes various buses and a processorconnected to the buses. The flash memory device 430 of the presentinvention is connected to is the buses and the processor can access theflash memory device 430.

The mobile terminal 410 is in operation and is executing the code, andthe partition 460 including the current activated code is beingexecuted.

The usage of these codes is well known in the field. Another partition450 contains dialing or audio data. For example, the mobile terminal 410can contain a dialing director or similar data in the data partition450.

The third partition 470 receives a new code 440 from an exterior. As oneexample, the third partition can be updated remotely. Accordingly, whilethe mobile terminal is operating, the new code 440 can be written to thenew code partition 470 and the data partition 450 can be used toreproduce the dialing data. At the same time, the code stored in thepartition 460 can be executed.

In this manner, the mobile terminal permits the update of the seamlessmobile telephone code, the simultaneous update, and the usage of themobile terminal. Other application fields such as the seamless codeupdate can be implemented similarly.

Additionally, the present invention is characterized in that the datacan be stored in the respective partitions by the dual journalingstoring method described and shown throughout the attached drawings.

INDUSTRIAL APPLICABILITY

According to the dual journaling storing method of an embodiment of thepresent invention, the data stored in the storage medium such as theflash memory are divided into the meta data and the general file data,and the file data are stored from the start locations of the storagemedium, that is, the respective partitions. The meta data are storedfrom the end locations of the respective partitions toward the startlocations.

In case the dual journaling storing method of embodiments of the presentinvention is used, data of the same kind is maintained in thepredetermined area. Therefore, the fast data access time can be obtainedand the erase times of the flash memory can be properly assigned to thespace of the flash memory.

Further, according to the dual journaling storing method of the presentinvention, in case data error occurs due to the power error, it is easyto restore the data to the previous version, thereby securing the datareliability.

While the present invention has been described and illustrated hereinwith reference to the preferred embodiments thereof, it will be apparentto those skilled in the art that various modifications and variationscan be made therein without departing from the spirit and scope of theinvention. Thus, it is intended that the present invention covers themodifications and variations of this invention that come within thescope of the appended claims and their equivalents.

1. A dual journaling storing method for storing data in a storagemedium, characterized in that data are stored from start and endlocations of the storage medium toward a central portion.
 2. The dualjournaling storing method according to claim 1, wherein when two typesof the data whose kind and characteristic are different are stored inthe storage medium, the two types of data are separately stored as afront journaling and a rear journaling, respectively.
 3. The dualjournaling storing method according to claim 2, wherein when the frontjournaling and the rear journaling meet each other at a centrallocation, data is again stored from the start location and the endlocation, respectively.
 4. The dual journaling storing method accordingto claim 2, wherein in case a head of the front journaling and a head ofthe rear journaling meet each other to form a central location for thefirst time and then the central location is formed for the second timeor more, the central location moves toward the other party's journalingwhen the head of the front journaling or the head of the rear journalingarrives again at the central location.
 5. A dual journaling storingmethod for inserting data into a storage medium, comprising the stepsof: when the insertion of the data into the storage medium is requested,performing a garbage collection if a storage space is insufficient,thereby moving the data and carrying out an erase operation; andchecking whether or not there is a sufficient space in the storagemedium after the data storage is completed, thereby securing a storagespace for a next inserted data.
 6. A method for storing data in astorage medium, comprising the steps of: dividing the data into a firstdata and a second data; and storing one of the first data and the seconddata from a start location of the storage medium, and storing the otherfrom an end location of the storage medium toward the start location. 7.The method according to claim 6, further comprising the step of: in casethe first data and the second data are stored and meet each other at acentral location, storing corresponding data again from the startlocation and the end location, respectively.
 8. The method according toclaim 7, further comprising the step of: when the central location isformed for the first time and then formed for a subsequent time, movingthe central location in a progressing direction of data arriving firstat the central location.
 9. A flash memory device comprising: aprocessor for generating a read/write command for reading/writing datafrom/to a specific address; a flash memory for providing a data storagespace; and a memory controller for controlling the data to be stored inthe flash memory from start and locations of the data storage spacetoward a central portion.
 10. A multiple-partitioned flash memory devicecomprising: a multiple-partitioned memory; a plurality of partitionsprovided by a multiple partition of the memory, in which data beingstored are independently read, written or erased; a charge pump forproviding a plurality of voltage levels necessary to read, write anderase the data; and a plurality of first sense amplifiers configured fora read operation, the read operation being simultaneously executable forthe respective partitions; a plurality of second sense amplifiersincluding at least one sense amplifier configured for erase and writeoperations, the erase and write operations being simultaneouslyexecutable for the respective partitions, wherein the data are stored inthe respective partitions from start and end locations of storage spacesof the respective partitions toward respective central portions.
 11. Themultiple-partitioned flash memory device according to claim 10, whereinin case the data whose characteristic are different are stored in thestorage medium, the data are separately stored as a front journaling anda rear journaling.
 12. The multiple-partitioned flash memory deviceaccording to claim 11, wherein in case the front journaling and the rearjournaling meet each other at a central location, the data is againstored from the start location.
 13. The multiple-partitioned flashmemory device according to claim 11, wherein in case a head of the frontjournaling and a head of the rear journaling meet each other to form acentral location for the first time and then the central location isformed for the second time or more, the central location moves towardthe other party's journaling when the head of the front journaling orthe head of the rear journaling arrives again at the central location.14. The multiple-partitioned flash memory device according to claim 10,wherein the data being stored in the respective partitions are dividedinto a meta data and a file data, the file data being stored from thestart locations of the respective partitions, the meta data being storedfrom the end locations of the respective partitions toward the startlocations.
 15. A mobile terminal adopting a multiple-partitioned memory,comprising: a bus; a processor connected to the bus; a flash memoryconnected to the bus and accessible by the processor, the flash memorybeing sectioned into a plurality of partitions, wherein data beingstored according to the respective partitions are independently read,written or erased; a plurality of first sense amplifiers configured fora first operation, the first operation being simultaneously executablefor the respective partitions; a plurality of second sense amplifiersincluding at least one sense amplifier configured for a secondoperation, the second operation being simultaneously executable for therespective partitions, wherein the data are stored in the respectivepartitions from start and end locations of storage spaces of therespective partitions toward respective central portions.
 16. The mobileterminal according to claim is, wherein in case the data whose kind andcharacteristic are different are stored in the storage medium, the dataare separately stored as a front journaling and a rear journaling. 17.The mobile terminal according to claim 16, wherein in case the frontjournaling and the rear journaling meet each other at a centrallocation, the data is again stored from the start location.
 18. Themobile terminal according to claim 16, wherein in case a head of thefront journaling and a head of the rear journaling meet each other toform a central location for the first time and then the central locationis formed for a subsequent time, the central location moves toward theother party's journaling when the head of the front journaling or thehead of the rear journaling arrives again at the subsequent centrallocation.
 19. The mobile terminal according to claim 15, wherein thedata being stored in the respective partitions are divided into a metadata and a file data, the file data being stored from the startlocations of the respective partitions, the meta data being stored fromthe end locations of the respective partitions toward the startlocations.
 20. A dual journaling storing method for storing data in amemory sectioned into multiple partitions, data being independentlyread, written or erased according to the respective partitions,characterized in that data are stored from start and end locations ofstorage spaces of the respective partitions toward a central portion.21. The dual journaling storing method according to claim 20, wherein incase the data whose characteristic are different are stored in a storagemedium, the data are separately stored as a front journaling and a rearjournaling.
 22. The dual journaling storing method according to claim21, wherein in case the front journaling and the rear journaling meeteach other at a central location, the data is again stored from thestart location and the end location, respectively.
 23. The dualjournaling storing method according to claim 21, wherein in case a headof the front journaling and a head of the rear journaling meet eachother to form a central location for the first time and then the centrallocation is formed for the second time or more, the central locationmoves toward the other party's journaling when the head of the frontjournaling or the head of the rear journaling arrives again at thecentral location.
 24. The dual journaling storing method according toclaim 21, wherein the data being stored in the respective partitions aredivided into a meta data and a file data, the file data being storedfrom the start locations of the respective partitions, the meta databeing stored from the end locations of the respective partitions towardthe start locations.
 25. A dual journaling storing method for storingdata in a memory sectioned into multiple partitions in case the data areinserted into the respective partitions of a flash memory, wherein thedata are independently read, written or erased according to therespective partitions, the dual journaling storing method comprising thesteps of: when the insertion of the data into the respective partitionsis requested, a storage medium performing a garbage collection if astorage space is insufficient, thereby moving the data and carrying outan erase operation; and checking whether there is a sufficient space inthe storage medium after the data storage is completed, thereby securinga storage space for a next inserted data.
 26. A mobile terminalcomprising: a bus; a processor connected to the bus; a memory connectedto the bus, data being read/written form/to the memory; and a memorycontroller for controlling the data to be written from start and endlocations of a storage space toward a central portion.